cmake_minimum_required(VERSION 3.1)

project(IM_UI_KIT LANGUAGES CXX)

set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

find_package(Qt5 COMPONENTS Core Quick REQUIRED)

add_executable(${PROJECT_NAME} "main.cpp" "qml.qrc"
    "Control/Init.cpp"
    "Control/PageControl.cpp"
    "Control/LoginControl.cpp"
    "Tool/IM_Core_Slots.cpp"
    "Tool/mythread.h"
    "Tool/TaskTool.cpp"
    "Model/UIFriendModel.cpp"
    "Model/UISessionModel.cpp"
    "Control/FriendAndSessionListControl.cpp"
    "IM_CoreApi.cpp"
    "Control/ListControl.cpp"
    "Model/UIMessageChatModel.cpp"
    "Control/MessageManager.cpp" )
target_compile_definitions(${PROJECT_NAME} PRIVATE $<$<OR:$<CONFIG:Debug>,$<CONFIG:RelWithDebInfo>>:QT_QML_DEBUG>)
if(WIN32)
target_link_libraries(${PROJECT_NAME} PRIVATE Qt5::Core Qt5::Quick
    )
endif()

if(UNIX)
    target_link_libraries(${PROJECT_NAME} PRIVATE Qt5::Core Qt5::Quick
        pthread)
endif()
